<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript" src="../../js/jquery-3.6.0.min.js"></script>
<a th:href="@{/prize/toAdd}">奖品录入</a>
<form th:action="@{/prize/queryprizeList}" method="post">
   商品名称：<input type="text" th:value="${prize.pname}" name="pname"><br>
    <input type="submit" value="提交">
</form>
<table border="1">
    <tr>
        <td>id</td>
       <td>奖品图</td>
        <td>奖品名称</td>
        <td>奖品类型</td>
        <td>奖品单价</td>
        <td>奖品数量</td>
    </tr>
    <tr th:each="prize:${pageInfo.list}">
        <td th:text="${prize.pid}"></td>
        <td>
            <img src="${prize.pimg}" width="50px" height="50xp" alt="">
        </td>
        <td th:text="${prize.pname}"></td>
        <td th:text="${prize.ptype}"></td>
        <td th:text="${prize.pprice}"></td>
        <td th:text="${prize.pstock}"></td>
    </tr>
</table>  <!--后面拼接的是条件-->
<p>当前 <span th:text="${pageInfo.pageNum}"></span> 页,总 <span th:text="${pageInfo.pages}"></span> 页,共 <span th:text="${pageInfo.total}"></span> 条记录</p>
<a th:href="@{/prize/queryprizeList(pname=${prize.pname})}">首页</a>
<a th:href="@{/prize/queryprizeList(pageNum=${pageInfo.hasPreviousPage}?${pageInfo.prePage}:1,pname=${prize.pname})}">上一页</a>
<a th:href="@{/prize/queryprizeList(pageNum=${pageInfo.hasNextPage}?${pageInfo.nextPage}:${pageInfo.pages},pname=${prize.pname})}">下一页</a>
<a th:href="@{/prize/queryprizeList(pageNum=${pageInfo.pages},pname=${prize.pname})}">尾页</a>
</body>
</html>